<template>
  <view class="container">
    <view class="msgBox">
      <image class="bgImg" src="/static/image/banner1.png" />
      <view class="title">国源公司智慧园区</view>
      <view class="content">请选择您要执行的操作</view>
    </view>
    <view class="tip">选错操作，需重新扫码进行选择</view>
    <view class="btnBox">
      <button
        class="btn"
        type="primary"
        @click="onLocation('/pages/patrol/list')"
      >
        设备巡检
      </button>
      <button
        class="btn"
        type="primary"
        @click="onLocation('/pages/baoshiBaoxiu/index')"
      >
        报事报修
      </button>
      <button
        class="btn"
        type="primary"
        @click="onLocation('/pages/repairService/index')"
      >
        零星报修
      </button>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      query: {},
    };
  },
  onLoad(query) {
    console.log(query);
    this.query = query;
  },
  onShow() {
    this.$nextTick(() => {});
  },
  methods: {
    // 跳转页面
    onLocation(url) {
      // url参数
      let str = this.$util.jsonToUrlParam(this.query);
      // redirectTo
      uni.navigateTo({
        url: url + `?${str}`,
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.container {
  min-height: calc(100vh - var(--window-top) - 96rpx);
  padding: 48rpx 40rpx;
  position: relative;
  .tip {
    color: rgba(0, 0, 0, 0.3);
    font-size: 20rpx;
    line-height: 40rpx;
    text-align: center;
  }
  .msgBox {
    padding: 48rpx 40rpx;
    border-radius: 10rpx;
    // background: #478CFF;
    position: relative;
    z-index: 1;
    .bgImg {
      width: 100%;
      height: 100%;
      position: absolute;
      top: 0;
      left: 0;
      z-index: -1;
    }
    .title {
      font-size: 48rpx;
      font-weight: bold;
      padding-bottom: 30rpx;
    }
    .content {
      color: #606266;
      padding: 12rpx 24rpx;
      border-radius: 6rpx;
      text-align: center;
      background: #fff;
    }
  }
  .btnBox {
    margin-top: 5vh;
    .btn {
      color: #fff;
      margin: 0 auto 30rpx;
    }
  }
}
</style>
